<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->bigIncrements('id')->comment('ID');
            $table->string('name', 64)->comment('用户名');
            $table->tinyInteger('status')->default(1)->comment('状态 1:正常 0:禁止');
            $table->string('mobile', 32)->nullable()->unique()->comment('手机号码');
            $table->string('email')->nullable()->unique()->comment('Email');
            $table->timestamp('email_verified_at')->nullable()->comment('email验证时间');
            $table->string('avatar', 255)->nullable()->unique()->comment('头像');
            $table->string('password')->comment('密码');
            $table->string('weixin_openid')->nullable()->comment('微信身份id');
            $table->string('weixin_unionid')->nullable()->comment('微信唯一id');
            $table->rememberToken();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}
